#define _CRT_SECURE_NO_WARNINGS 1

#include <iostream>
#include <vector>
#include <string>
#include <sstream>
#include <algorithm>
#include <climits>
using namespace std;

vector<string> split(const string& s) 
{
    vector<string> ret;
    string str;
    istringstream tokenStream(s);
    while (getline(tokenStream, str, ','))
    {
        ret.push_back(str);
    }
    return ret;
}

int main() 
{
    string in;
    getline(cin, in);
    vector<string> strs = split(in);

    int hash[26] = { 0 };
    for (int i = 0; i < 26; i++) hash[i] = INT_MAX;

    for (const string& s : strs) 
    {
        int freq[26] = { 0 };
        for (auto c : s) freq[c - 'a']++;
        for (int i = 0; i < 26; i++) 
            hash[i] = min(hash[i], freq[i]);
    }

    vector<char> ret;
    for (int i = 0; i < 26; i++) 
    {
        for (int j = 0; j < hash[i]; j++)
        {
            ret.push_back('a' + i);
        }
    }

    if (ret.size())
    {
        cout << "[";
        for (int i = 0; i < ret.size(); i++)
        {
            if (i > 0) cout << " ";
            cout << ret[i];
        }
        cout << "]" << endl;
    }
    else 
        cout << "[]" << endl;

    return 0;
}